/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase - Num2816
 * <p>Powered by webrx On 2021-11-22 14:19:16
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Num2816 {
    public static void main(String[] args) {
        int num = 12;
        System.out.println(num);

        //十进制转换为二进制字符串 //1100
        System.out.println(Integer.toBinaryString(num));

        //十进制转换为十六进制 //c
        System.out.println(Integer.toHexString(num));

        //十进制转换为八进制 14
        System.out.println(Integer.toOctalString(num));

        //十六进制转换为 10 FF 255
        System.out.println(Integer.valueOf("ff", 16));
        //12 16进制转10
        System.out.println(Integer.valueOf("c", 16));
        //12 16进制转10
        System.out.println(Integer.valueOf("0c", 16));
        //12 2进制转10
        System.out.println(Integer.valueOf("1100", 2));
        //12 8进制转10
        System.out.println(Integer.valueOf("14", 8));
    }
}
